import createdName from '../../../utils/createdName'
import Icon from '../icon/index'
export default {
  name: createdName('Link'),
  props: {
    type: {
      type: String,
      default: 'default',
      note: '链接的颜色',
      options: ['primary', 'success', 'warning', 'danger', 'info'],
    },
    disabled: {
      type: Boolean,
      default: false,
      note: '是否禁用'
    },
    underline: {
      type: Boolean,
      default: true,
      ntoe: '是否有下划线,默认有'
    }
  },
  render (h) {
    const _self = this;
    return h('a', {
      class: ['yc-link', ' yc-link--' + _self.type, , _self.disabled ? 'is-disabled' : (_self.underline && 'is-underline')]
    }, [
      _self.icon && h(Icon, {
        class: _self.icon
      }),
      h('span', {
        class: ['yc-link--inner']
      }, _self.$slots.default)
    ])
  }
}